package com.csun.cmny.provider.controller.rpc;

import com.csun.cmny.provider.model.vo.WatchOldmanAddressVo;
import com.csun.cmny.provider.service.DmcWatchDataFeignApi;
import com.csun.cmny.provider.service.DmcWatchDataService;
import com.csun.cmny.util.wrapper.WrapMapper;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-03-11 21:46
 * @Description: the class dmc device feign client
 */
@RestController
public class DmcWatchDataFeignClient implements DmcWatchDataFeignApi {

    @Resource
    private DmcWatchDataService dmcWatchDataService;

    /**
     * 根据老人Id获取老人手环位置数据
     *
     * @param oldmanIds
     * @return
     */

    @Override
    public Wrapper<List<WatchOldmanAddressVo>> queryWatchOldmanAddressByOldmanIds(@RequestParam("oldmanIds") List<Integer> oldmanIds) {

        List<WatchOldmanAddressVo> watchOldmanAddressVoList =
                dmcWatchDataService.queryWatchOldmanAddressByOldmanIds(oldmanIds);

        return WrapMapper.ok(watchOldmanAddressVoList);
    }
}
